package com.appkubes.fintech.restful.application.mall.controller;

import com.alibaba.fastjson.JSONObject;
import com.appkubes.fintech.common.response.Response;
import com.appkubes.fintech.restful.application.mall.service.MallService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: Rongjie
 * @Date: 2020/2/29
 * @Description:
 */
@Api(tags = "商城服务")
@RestController
@RequestMapping("/mall/api")
public class MallController {
    @Resource
    MallService mallService;

    @GetMapping("/user/hierarchy/{userKey}")
    public Response hierarchy(@PathVariable("userKey") String userKey) {
        JSONObject jsonObject = mallService.getUserHierarchyData(userKey);
        return Response.success(jsonObject);
    }
}
